﻿<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="database.DAO, golf.ScoreCard, golf.Character"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>게임 이력 보기</title>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<h1>게임 이력 보기</h1>
<%
DAO dao = DAO.getInstance();
int charNo = (Integer)session.getAttribute("charNo");
ScoreCard[] scores = dao.getScoreCardList(charNo);
Character character = dao.getCharacter(charNo);
%>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<h3><%=character.getName() %>의 평균 정보</h3>
<table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black" width="33%">
    <tr>
        <td width="188"><span style="font-size:9pt;">평균핸디</span></td>
        <td width="239"><span style="font-size:9pt;"><%=character.getRecent_avg_hand() %></span></td>
    </tr>
    <tr>
        <td width="188"><span style="font-size:9pt;">홀인원수</span></td>
        <td width="239"><span style="font-size:9pt;"><%=character.getHoleinone_cnt() %></span></td>
    </tr>
    <tr>
        <td width="188" height="15"><span style="font-size:9pt;">최고비거리</span></td>
        <td width="239" height="15"><span style="font-size:9pt;"><%=character.getHigh_distance() %></span></td>
    </tr>
</table>
<br>
<h3>게임 별 정보</h3>
<table border="1" cellspacing="0" bordercolordark="white" bordercolorlight="black">
    <tr>
    	<td width="200"><span style="font-size:9pt;">방이름</span></td>
        <td width="150"><span style="font-size:9pt;">코스이름</span></td>
        <td width="100"><span style="font-size:9pt;">게임타입</span></td>
        <td width="50"><span style="font-size:9pt;">게임홀수</span></td>
        <td width="50"><span style="font-size:9pt;">스코어</span></td>
    </tr>
    <%
    if(scores != null ){
	    for( int i = 0; i < scores.length; i++ ){
	    %>
	    <tr>
	    	<td width="200"><span style="font-size:9pt;"><%=scores[i].getRoom().getName() %></span></td>
	        <td width="150"><span style="font-size:9pt;"><%=scores[i].getRoom().getGame().getCourse().getName() %></span></td>
	        <td width="100"><span style="font-size:9pt;"><%=scores[i].getRoom().getGame().getGame_type() %></span></td>
	        <td width="50"><span style="font-size:9pt;"><%=scores[i].getRoom().getGame().getHole_cnt() %></span></td>
	        <td width="50"><span style="font-size:9pt;"><%=scores[i].getScore() %></span></td>
	    </tr>
	    <%} %>
	<%} %>
</table>
<p>&nbsp;</p>
</body>

</html>